﻿using FluentScheduler;
using System;

namespace ScheduleDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            JobManager.Initialize(new CronRegistry());
            //JobManager.GetSchedule("HelloJob").Execute();
            Console.ReadKey();
        }
    }

    internal class CronRegistry : Registry
    {
        public CronRegistry()
        {
            Schedule<HelloJob>().ToRunEvery(5).Seconds();
        }
    }

    internal class HelloJob : IJob
    {
        public void Execute()
        {
            Console.WriteLine($"hello world. {DateTime.Now.ToString("HH:mm:ss")}");
        }
    }
}
